package com.shse.service.impl;

import com.shse.dao.UserDao;
import com.shse.meta.User;
import com.shse.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by shse on 3/12/2016.
 */

@Component("userService")
public class UserServiceImpl implements UserService{

    @Autowired
    private UserDao userDao;

    @Override
    public List<User> getAllUser() {
        return userDao.getAllUser();
    }

    @Override
    public User getUserById(String  id) {
        return userDao.getUserById(String.valueOf(id));
    }

    @Override
    public User login(String username, String password) {
        User user = userDao.getUser(username, password);

        return user;
    }
}
